using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Channels;
using System.Data;
using ProyectoCompartido;
using System.Diagnostics;

namespace Client
{
    public class Principal
    {
        

        public static void Main(string[] args)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(1033);
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(1033);

            ChannelFactory<IServicio> factory = new ChannelFactory<IServicio>("ServidorWCF");
            IServicio proxy = null;


            /////////////// SERVICIO WCF ///////////////
            proxy = factory.CreateChannel();
            Console.WriteLine("Se creo el canal WCF");
            Console.WriteLine(proxy.holaMundo("Estoy desde el canal WCF"));
            ((IChannel)proxy).Close();
            proxy = null;

            /////////////// SERVICIO .NET REMOTING ///////////////
            proxy = (IServicio)Activator.GetObject(typeof(IServicio), "tcp://localhost:63099/ServidorNetRemoting.rem");
            Console.WriteLine("Se creo el canal Remoting");
            Console.WriteLine(proxy.holaMundo("Estoy desde el canal con la tecnologia .NET Remoting"));
            proxy = null;

            Console.ReadKey();
        }
    }
}
